package com.wushi.lenovo.asia5b.app_ui.pay.fragment;

import android.os.Bundle;
import android.view.View;

import com.wushi.lenovo.asia5b.R;
import com.wushi.lenovo.asia5b.app_model.credit.bean.ThirdTopupType;
import com.wushi.lenovo.asia5b.app_model.credit.bean.TopupInfoBean;
import com.wushi.lenovo.asia5b.app_model.other.WebUrlType;
import com.wushi.lenovo.asia5b.app_ui.credit.fragment.CardFragment;
import com.wushi.lenovo.asia5b.app_ui.pay.activity.PayInsVesselActivity;
import com.wushi.lenovo.asia5b.app_utils.eye.EyeUtils;

/**
 * Created by zhangyuncai on 2020/3/5.
 * 订单支付余额不足差额Visa付款
 */
public class PayInsCardFragment extends CardFragment {
    private PayInsVesselActivity payInsVesselActivity;
    private TopupInfoBean topupInfoBean;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        thirdTopupType = ThirdTopupType.thirdtopup_from_orderpayment_ins_by_creditcard;
        payInsVesselActivity = (PayInsVesselActivity) mActivity;
        topupInfoBean = payInsVesselActivity.topupInfoBean;
    }

    @Override
    protected void setView() {
        super.setView();
        et_card_amount.setText(topupInfoBean.getDiffAmount() + "");
        bt_card_submit.setText(R.string.orderpayment_proceedpayment);
        tv_card_notice.setVisibility(View.VISIBLE);
        //超链接
        EyeUtils.setLinkText(mActivity, getString(R.string.shopcar_pi_notice), getString(R.string.shopcar_pi_notice_key),
                tv_card_notice, WebUrlType.shopcar_pi);
    }

    @Override
    protected float getAmount() {
        return topupInfoBean.getDiffAmountF();
    }

    @Override
    protected int getCheckout_log_id() {
        return topupInfoBean.getCheckout_log_id();
    }

    @Override
    public TopupInfoBean getTopupInfoBean() {
        return topupInfoBean;
    }
}
